package com.yonyou.pmclouds.procedure.rmiitf;

import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.procedure.entity.ProcedureVO;

import java.util.List;

public interface ProcedureMaintain {
    String insert(ProcedureVO procedureVO) throws BusinessException;

    String update(ProcedureVO procedureVO) throws BusinessException;

    String delete(String procedureid, String changeFlag) throws BusinessException;

    /**
     * 导入工序模板专用接口，批量导入，只校验名称和编码是否重复
     */
    String[] insertPresetProcedures(List<ProcedureVO> list) throws BusinessException;//

    /**
     * Excel导入工序
     * @param list 根工序(树)的集合
     * @return 所有被插入的工序的id数组
     */
    String[] insertExcelProcedures(List<ProcedureVO> list) throws BusinessException;

    /**
     * 启用
     *
     * @param procedureVO
     * @return
     * @throws BusinessException
     */
    ProcedureVO enable(ProcedureVO procedureVO) throws BusinessException;

    /**
     * 停用
     *
     * @param procedureVO
     * @return
     * @throws BusinessException
     */
    ProcedureVO disable(ProcedureVO procedureVO) throws BusinessException;

    /**
     * 校验工序是否被引用
     *
     * @param procedureid
     * @param tenantid
     * @return
     * @throws BusinessException
     */
    int getProcedureRefStatus(String procedureid, String tenantid) throws BusinessException;

    boolean referenceCheck(String procedureid) throws BusinessException;

}
